const express = require('express')

const app = express()

app.listen(80, () => {
    console.log('express server running: http://127.0.0.1')
})


// 解析json格式数据，json解析中间件
app.use(express.json())

// 解析表单
app.use(express.urlencoded({extends: false}))




// post：模拟json请求体
app.post('/user', function (req, resp) {

    console.log(req.body)

    resp.send('请求成功')
})

// post:模拟表单提交
app.post('/book', function (req, resp) {

    console.log(req.body)

    resp.send('请求成功')
})


